package com.example.mapper;

import com.example.entity.City;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * 操作city相关数据接口
*/
public interface CityMapper {
    void insert(City city);

    @Select("select*from city")
    List<City> selectAll();

    @Select("select*from city where name like concat('%',#{name},'%')")
    List<City> selectByName(String name);

    void updateById(City city);

    @Delete("delete from city where id = #{id}")
    void deleteById(Integer id);


}